import request from '@/utils/request'
/**
 *实现新增部门
 */
export function addDepartment(data) {
  return request({
    url: '/company/department',
    method: 'post',
    data
  })
}

/**
 *查询企业的部门列表
 */
export function getDepartment() {
  return request({
    url: '/company/department',
    method: 'get'
  })
}

/**
 *根据ID修改部门详情
 */
export function updateDepartmentById(data) {
  return request({
    url: `/company/department/${data.id}`,
    method: 'put',
    data
  })
}

/**
 *根据ID删除部门
 */
export function delDepartmentById(id) {
  return request({
    url: `/company/department/${id}`,
    method: 'DELETE'
  })
}

/**
 *根据ID查询部门详情
 */
export function getDepartmentDetail(id) {
  return request({
    url: `/company/department/${id}`,
    method: 'get'
  })
}
